package cate.common.table.activity.crossrankactivity.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.rankactivity.row.RankActivityRewardRow;

public class CrossRankActivityRewardSheet extends ESheet<RankActivityRewardRow> {
    @Override
    public String getSheetName() {
        return "排行榜活动奖励";
    }

    /**
     * 获取奖励配置
     *
     * @param group 分组
     * @param rankIndex 排行索引
     */
    public RankActivityRewardRow getRewardRow(int group, int rankIndex){
        for (RankActivityRewardRow tpl : getList()) {
            if (tpl.group == group) {
                if (rankIndex >= tpl.begin && rankIndex <= tpl.end) {
                    return tpl;
                }
            }
        }
        return null;
    }
}
